import React, {Component} from 'react';
import {
    WingBlank,
    WhiteSpace,
    Button
} from 'antd-mobile';

export default class Home extends Component {
    constructor(props) {
        super(props);
        this.skipLogin = this.skipLogin.bind(this);
        this.skipRegister = this.skipRegister.bind(this);
    }

    render() {
        return (
            <div>
                <h1 align="center">首页</h1>
                <WingBlank>
                    <Button type="primary" onClick={this.skipLogin}>前往登录</Button>
                    <WhiteSpace size="xl"/>
                    <Button type="primary" onClick={this.skipRegister}>前往注册</Button>
                </WingBlank>
            </div>
        )
    }

    //前往注册
    skipLogin() {
        this.props.history.push('/login');
    }

    //前往注册
    skipRegister() {
        this.props.history.push('/register');
    }
}